<%@ page import="com.hotel.entity.Bookid" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="<%=request.getContextPath()%>/hotel/js/calendar.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/hotel/style/style.css"></link>
    <style type="text/css">
        #content div {
            margin: 10px 0px;
        }

        table {
            margin: auto;
            margin-top: 20px;
            width: 700px;
            border-collapse: collapse;
        }

        th, td {
            border: solid 1px #000000;
            padding: 6px 1px;
        }

        .index {
            width: 50px;
            text-align: center;
        }

        .no {
            text-align: center;
        }

        .shortname {
            text-align: center;
        }

        .phone {
        }

        .opt {
            text-align: center;
        }

        #content div {
            text-align: center;
            margin: 0;
            padding: 0;
        }

        #content div.button {
            text-align: center;
            padding-top: 15px;
        }
    </style>
    <title>客房列表</title>
</head>
<body>
<div id="container">
    <div id="header">
        <ul>
            <li>
                <a href="<%=request.getContextPath()%>/hotel/manager/login.jsp"
                   onclick="return confirm('确定要退出登录吗？');">退出</a>
            </li>

        </ul>
    </div>
    <div id="menu">
        <ul>
            <li><a href="<%=request.getContextPath()%>/hotel/manager/bookQuery.jsp">客房管理</a></li>
            <li><a href="<%=request.getContextPath()%>/hotel/manager/memberQuery.jsp">会员管理</a></li>
            <li><a href="<%=request.getContextPath()%>/hotel/manager/subscriptionQuery.jsp">订单管理</a></li>
        </ul>
    </div>
    <div id="content">
        <table>
            <colgroup>
                <col class="index" />
                <col class="no" />
                <col class="shortname" />
                <col class="phone" />
                <col class="opt" />
            </colgroup>
            <tr>
                <th>序号</th>
                <th>书名</th>
                <th>编号</th>
                <th>状态</th>
                <th>操作</th>
            </tr>

            <%
                // 获取房间列表
                List<Bookid> bookidList = (List<Bookid>) request.getAttribute("bookidList");
                if (bookidList != null) {
                    int index = 1;
                    for (Bookid bookid : bookidList) {
            %>
            <tr>
                <td><div><%= index++ %></div></td>
                <td><div><%= bookid.getBookidTypeName() %></div></td>
                <td><div><%= bookid.getNo() %></div></td>
                <td><div><%= bookid.getStatusName() %></div></td>
                <td>
                    <div>
                        <% if ("已借出".equals(bookid.getStatusName())) { %>
                        <a href="<%=request.getContextPath()%>/checkout.member?bookidNo=<%= bookid.getNo() %>&action=path" onclick="return confirm('是否完成还书？')">还书</a>
                        <% } else { %>
                        &nbsp;
                        <% } %>
                    </div>
                </td>
            </tr>
            <%
                    }
                }
            %>
        </table>
        <div class="button">
            <input type="button" value="返回" onclick="goBack()">
            <script>
                function goBack() {
                    window.history.back();
                }
            </script>
        </div>
    </div>
    <hr />
    <div id="footer">
        <p>本系统做为Java Web教学设计使用。未经允许，不得做为它用，版权所有Allan<br />联系方式：javamedia@live.cn</p>
    </div>
</div>
</body>
</html>
